package com.hhlkeepalive.ndkAlive;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.Process;
import android.support.annotation.Nullable;
import android.util.Log;

import com.hhlkeepalive.Watcher;

import java.util.Timer;
import java.util.TimerTask;

public class PushService extends Service {

    private int tag=1;

    @Override
    public void onCreate() {
        super.onCreate();
        Watcher watcher=new Watcher();
        watcher.creatLinuxServiceScoket(String.valueOf(Process.myUid()));
        watcher.connectToService();


        //还存活的标志
        Timer timer=new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                Log.e("TAG","计数器"+tag);
                tag++;
            }
        },0,3000);

    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
